package com.wdf.dota;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class Dota2MenuActivity extends TabActivity {

	public TabHost tabHost;
	public static final String TAB_HERO="英雄";
	public static final String TAB_EQUI="装备";
	

	public RadioGroup radioGroup;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dota2_menu);
	
		try {

        tabHost=this.getTabHost();
        
        TabSpec ts1=tabHost.newTabSpec(TAB_HERO).setIndicator(TAB_HERO);
        Intent intent1 = new Intent(Dota2MenuActivity.this,Dota2HeroMenuActivity.class);
        ts1.setContent(intent1);
        tabHost.addTab(ts1);
        
        TabSpec ts2=tabHost.newTabSpec(TAB_EQUI).setIndicator(TAB_EQUI);
        Intent intent2 = new Intent(Dota2MenuActivity.this,Dota2EquipmentActivity.class);
        ts2.setContent(intent2);
        tabHost.addTab(ts2);

        this.radioGroup=(RadioGroup)findViewById(R.id.main_radio);
        radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {

			public void onCheckedChanged(RadioGroup group, int checkedId) {
				
				switch(checkedId){
				case R.id.radio_button0:
					tabHost.setCurrentTabByTag(TAB_HERO);
					break;
				case R.id.radio_button1:
					tabHost.setCurrentTabByTag(TAB_EQUI);
					break;

				}
			}
		});
   
		} catch (Exception e) {
			e.printStackTrace();
		}
		

       
	}


	   public void onResume() {
		   super.onResume();
		 
		   }
		   public void onPause() {
		   super.onPause();
		
		   }
		   

}
